<template>
  <div class="box">
    <!-- 筛选条件 -->
    <div class="tab">
      <span>星选餐厅</span>
      <span>排队取号</span>
      <span>预约订座</span>
    </div>
    <!-- 渲染数据列表 -->
    <div class="list">
      <!-- 每一项 -->

      <div class="listItem" v-for="item in BaseQueryList" :key="item.shopId">
        <!-- 左侧图片 -->
        <div class="listItemL">
          <img :src="item.logo" alt="" />
        </div>
        <!-- 右侧数据 -->
        <div class="listItemR">
          <!-- 店铺名称 -->
          <h3 class="listItemRName">{{ item.shopName }}</h3>
          <!-- 评分 人均 -->
          <div class="listItemRDegree">
            <span>{{ item.avgReview }}</span>
            <span>{{ item.avgPrice }}</span>
          </div>
          <!-- 类型  距离 -->
          <div class="listItemRType">
            <span>{{ item.styleCooking }}</span>
            <span>{{ item.distance.toFixed(2) }}km</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

import { getBaseQueryList } from "../services";
export default {
  data() {
    return {
      //商家列表数据
      BaseQueryList: [],
    };
  },
  mounted() {
    this.getBaseQueryList();
  },

  methods: {
    //餐厅列表
    async getBaseQueryList() {
      let res = await getBaseQueryList();
      if (res.errNo == 0) {
        this.BaseQueryList = res.data.shops;
      }
      console.log("getBaseQueryList...11", this.BaseQueryList);
    },
  },
};
</script>

<style lang="scss" scoped>
.box {
  width: 100%;
  //筛选数据样式
  .tab {
    width: 100%;
    display: flex;
    justify-content: space-between;
    > span {
      font-size: 24rpx;
      padding: 10rpx 40rpx;
      background: #f5f5f5;
      border-radius: 20rpx;
    }
  }
  //列表数据样式
  .list {
    width: 100%;
    .listItem {
      width: 100%;
      margin: 20rpx 0;
      padding: 20rpx 0;
      display: flex;
      // <!-- 左侧图片 -->
      .listItemL {
        width: 150rpx;
        height: 150rpx;
        margin-right: 20rpx;
        img {
          width: 100%;
          height: 100%;
        }
      }
      // 右侧数据
      .listItemR {
        flex: 1;
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid #999;
        .listItemRName {
          font-weight: 600;
          font-size: 34rpx;
        }
        // 评分 人均  类型  距离
        .listItemRDegree,
        .listItemRType {
          width: 100%;
          display: flex;
          margin: 10rpx 0;
          > span {
            margin-right: 20rpx;
            font-size: 26rpx;
            color: #999;
          }
        }
      }
    }
  }
}
</style>